package com.wbp.cms.qatest.service;

import java.util.Date;

import javax.annotation.Resource;

import org.junit.Test;

import com.wbp.cms.client.project.domain.ProjectDO;
import com.wbp.cms.client.project.service.ProjectService;
import com.wbp.cms.client.result.Result;
import com.wbp.cms.client.util.JsonUtils;
import com.wbp.cms.qatest.BaseTest;


/**
 * @Description:
 * @Department:
 * @author andy.lhc
 * @date 2016年3月30日 下午5:43:02
 */
public class ProjectServiceTest extends BaseTest {

  @Resource
  private ProjectService projectService;

  @Test
  public void test_增加预约项目() {

    ProjectDO projectDO = new ProjectDO();
    projectDO.setProjectName("tes-0002");
    projectDO.setProductId(1L);
    projectDO.setCustomerId(36L);
    projectDO.setCustomerName("lihc");
    projectDO.setUserId(10L);
    projectDO.setUserName("yu");
    projectDO.setPreAmount(200.00d);
    projectDO.setReserveType(1);
    projectDO.setType(1);
    projectDO.setPaymoneyDate(new Date().toLocaleString());
    projectDO.setStatus(1);
    projectDO.setMobileNumber("133444433");
    projectDO.setIdCard("345333333344");

    Result<Long> r = this.projectService.addProject(projectDO);
    System.out.println(JsonUtils.toJson(r, true));

  }

  @Test
  public void test_增加预约项目2() {

    ProjectDO projectDO = new ProjectDO();
    projectDO.setProjectName("tes-0003测试产品");
    projectDO.setProductId(1L);
    projectDO.setCustomerId(36L);
    projectDO.setCustomerName("lihc");
    projectDO.setUserId(10L);
    projectDO.setUserName("yu");
    projectDO.setPreAmount(200.00d);
    projectDO.setReserveType(2);
    projectDO.setType(2);
    projectDO.setPaymoneyDate(new Date().toLocaleString());
    projectDO.setStatus(1);
    projectDO.setMobileNumber("133444433");
    projectDO.setIdCard("345333333344");

    Result<Long> r = this.projectService.addProject(projectDO);
    System.out.println(JsonUtils.toJson(r, true));

  }

  /*@Test
  public void test_修改预约项目1() {

    Result<ProjectDO> r = this.projectService.loadProject(5L);
    if (r.isSuccess()) {
      ProjectDO projectDO = r.getData();
      projectDO.setComments("test111测试");
      Result<Boolean> r1 = this.projectService.modifyProject(projectDO);
      System.out.println(JsonUtils.toJson(r1, true));
    }

  }*/

  @Test
  public void test_修改预约项目2() {

    Result<ProjectDO> r = this.projectService.loadProject(5L);
    if (r.isSuccess()) {
      ProjectDO projectDO = r.getData();
      projectDO.setComments("test222测试");
      projectDO.setStatus(2);
      Result<Boolean> r1 = this.projectService.modifyProject(projectDO);
      System.out.println(JsonUtils.toJson(r1, true));
    }

  }
  
  @Test
  public void test_修改预约项目3() {

    Result<ProjectDO> r = this.projectService.loadProject(5L);
    if (r.isSuccess()) {
      ProjectDO projectDO = r.getData();
      projectDO.setComments("test333测试");
      projectDO.setStatus(3);
      Result<Boolean> r1 = this.projectService.modifyProject(projectDO);
      System.out.println(JsonUtils.toJson(r1, true));
    }

  }
  
  @Test
  public void test_修改预约项目4() {

    Result<ProjectDO> r = this.projectService.loadProject(5L);
    if (r.isSuccess()) {
      ProjectDO projectDO = r.getData();
      projectDO.setComments("test444测试");
      projectDO.setStatus(4);
      Result<Boolean> r1 = this.projectService.modifyProject(projectDO);
      System.out.println(JsonUtils.toJson(r1, true));
    }

  }
  
  @Test
  public void test_修改预约项目5() {

    Result<ProjectDO> r = this.projectService.loadProject(5L);
    if (r.isSuccess()) {
      ProjectDO projectDO = r.getData();
      projectDO.setComments("test55测试");
      projectDO.setStatus(5);
      Result<Boolean> r1 = this.projectService.modifyProject(projectDO);
      System.out.println(JsonUtils.toJson(r1, true));
    }

  }

  @Test
  public void test_修改预约项目6() {

    Result<ProjectDO> r = this.projectService.loadProject(5L);
    if (r.isSuccess()) {
      ProjectDO projectDO = r.getData();
      projectDO.setComments("test66测试");
      projectDO.setStatus(6);
      Result<Boolean> r1 = this.projectService.modifyProject(projectDO);
      System.out.println(JsonUtils.toJson(r1, true));
    }
  }
  
  @Test
  public void test_修改预约项目7() {

    Result<ProjectDO> r = this.projectService.loadProject(4L);
    if (r.isSuccess()) {
      ProjectDO projectDO = r.getData();
      projectDO.setComments("test77测试");
      projectDO.setStatus(7);
      Result<Boolean> r1 = this.projectService.modifyProject(projectDO);
      System.out.println(JsonUtils.toJson(r1, true));
    }
  }
  
  @Test
  public void test_修改预约项目8() {

    Result<ProjectDO> r = this.projectService.loadProject(4L);
    if (r.isSuccess()) {
      ProjectDO projectDO = r.getData();
      projectDO.setComments("test88测试");
      projectDO.setStatus(8);
      Result<Boolean> r1 = this.projectService.modifyProject(projectDO);
      System.out.println(JsonUtils.toJson(r1, true));
    }
  }

}
